package meng.study.redis.jedis;

import redis.clients.jedis.JedisPubSub;

/**
 * 我的订阅方
 * 
 * @author mengzhang6
 *
 */
public class MyJedisPubSub extends JedisPubSub {

	@Override
	public void onMessage(String channel, String message) {
		System.out.println("onMessage");
		System.out.println(channel);
		System.out.println(message);
	}

	@Override
	public void onPMessage(String pattern, String channel, String message) {
		System.out.println("onPMessage");
		System.out.println(channel);
		System.out.println(message);
	}

	@Override
	public void onSubscribe(String channel, int subscribedChannels) {
		System.out.println("onSubscribe");
		System.out.println(channel);
		System.out.println(subscribedChannels);
	}

	@Override
	public void onUnsubscribe(String channel, int subscribedChannels) {
		System.out.println("onUnsubscribe");
		System.out.println(channel);
		System.out.println(subscribedChannels);
	}

	@Override
	public void onPUnsubscribe(String pattern, int subscribedChannels) {
		System.out.println("onPUnsubscribe");
		System.out.println(pattern);
		System.out.println(subscribedChannels);
	}

	@Override
	public void onPSubscribe(String pattern, int subscribedChannels) {
		System.out.println("onPSubscribe");
		System.out.println(pattern);
		System.out.println(subscribedChannels);
	}

	@Override
	public void onPong(String pattern) {
		System.out.println("onPong");
		System.out.println(pattern);

	}

}
